]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
loginDialog: fix up cancel button visibility
authorRay Strode <rstrode@redhat.com>
Mon, 29 Jul 2013 00:55:12 +0000 (20:55 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 8 Aug 2013 14:55:34 +0000 (10:55 -0400)
This commit makes sure we hide when there's nothing to cancel
to and show it when there's something to cancel to.

https://bugzilla.gnome.org/show_bug.cgi?id=683437

js/gdm/loginDialog.js
src/gvc

index 9286f9857152a4722a9fa329975b1c49894ab8b5..27c7ef1d32644990887ce3725130a7cb302b353a 100644 (file)
@@ -534,6 +534,19 @@ const LoginDialog = new Lang.Class({
         }
     },
 
+    _updateCancelButton: function() {
+        let cancelVisible;
+
+        // Hide the cancel button if the user list is disabled and we're asking for
+        // a username
+        if (this._authPrompt.verificationStatus == AuthPrompt.AuthPromptStatus.NOT_VERIFYING && this._disableUserList)
+            cancelVisible = false;
+        else
+            cancelVisible = true;
+
+        this._authPrompt.cancelButton.visible = cancelVisible;
+    },
+
     _updateBanner: function() {
         let enabled = this._settings.get_boolean(GdmUtil.BANNER_MESSAGE_KEY);
         let text = this._settings.get_string(GdmUtil.BANNER_MESSAGE_TEXT_KEY);
@@ -569,9 +582,6 @@ const LoginDialog = new Lang.Class({
 
         if (this._shouldShowSessionMenuButton())
             this._authPrompt.setActorInDefaultButtonWell(this._sessionMenuButton.actor);
-
-        this._authPrompt.cancelButton.show();
-
         this._showPrompt();
     },
 
@@ -644,11 +654,12 @@ const LoginDialog = new Lang.Class({
                                                         this._authPrompt.clear();
                                                         this._authPrompt.startSpinning();
                                                         this._authPrompt.begin({ userName: answer });
+                                                        this._updateCancelButton();
 
                                                         realmManager.disconnect(realmSignalId)
                                                         realmManager.release();
                                                     }));
-        this._authPrompt.cancelButton.hide();
+        this._updateCancelButton();
         this._showPrompt();
     },
 
@@ -846,6 +857,8 @@ const LoginDialog = new Lang.Class({
 
         this._user = activatedItem.user;
 
+        this._updateCancelButton();
+
         let batch = new Batch.ConcurrentBatch(this, [new Batch.ConsecutiveBatch(this, tasks),
                                                      this._beginVerificationForItem(activatedItem)]);
         batch.run();
diff --git a/src/gvc b/src/gvc
index ed0ec4240125ac9f0a6d7502aa29644d37b2eac2..3d6aac673b88fff548db57a75b82e8f14723c1fe 160000 (submodule)
--- a/src/gvc
+++ b/src/gvc
@@ -1 +1 @@
-Subproject commit ed0ec4240125ac9f0a6d7502aa29644d37b2eac2
+Subproject commit 3d6aac673b88fff548db57a75b82e8f14723c1fe